solved example finding initial values and final values